package com.ag.zrt.action;

import javax.annotation.Resource;

import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.ag.common.BaseAction;
import com.ag.zrt.service.IUpdateCTIService;

@Controller("ZRTupdateCTIAction")
@Scope(BeanDefinition.SCOPE_PROTOTYPE)
public class UpdateCTIAction extends BaseAction {

	private static final long serialVersionUID = 8395897899230863020L;

	private String UId;
	private String UCtiId;
	private String UCtiNumber;
	private String UCtiQueue;
	private String UCtiPsw;
	@Resource(name = "ZRTUpdateCTIService")
	private IUpdateCTIService updateCTIService;

	public String getUId() {
		return UId;
	}

	public void setUId(String uId) {
		UId = uId;
	}

	public String getUCtiId() {
		return UCtiId;
	}

	public void setUCtiId(String uCtiId) {
		UCtiId = uCtiId;
	}

	public String getUCtiNumber() {
		return UCtiNumber;
	}

	public void setUCtiNumber(String uCtiNumber) {
		UCtiNumber = uCtiNumber;
	}

	public String getUCtiQueue() {
		return UCtiQueue;
	}

	public void setUCtiQueue(String uCtiQueue) {
		UCtiQueue = uCtiQueue;
	}

	public String getUCtiPsw() {
		return UCtiPsw;
	}

	public void setUCtiPsw(String uCtiPsw) {
		UCtiPsw = uCtiPsw;
	}

	public void setUpdateCTIService(IUpdateCTIService updateCTIService) {
		this.updateCTIService = updateCTIService;
	}

	public String updateCTI() {
		try {
			System.out.println("uId: " + UId + "  uCtiId:" + UCtiId
					+ " uCtiNumber:" + UCtiNumber + " uCtiQueue:" + UCtiQueue
					+ " uCtiPsw:" + UCtiPsw);
			updateCTIService.updateAgent(UId, UCtiId, UCtiNumber, UCtiQueue,
			UCtiPsw);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return "update";
	}

}
